<div class="collapse navbar-collapse" id="sidebarCollapse">
    <ul class="navbar-nav">
        <li class="nav-item">
            <a class="nav-link active" href="#" role="button">
                <i class="fe fe-home"></i> 模块儿系统首页
            </a>
        </li>
        {{--通过循环菜单配置文件保存在admin_modules中admin_menu中的字段内容来循环输出页面表单--}}
        @foreach(admin_menus() as $topmenu)
            @if(auth()->user()->hasAnyPermission($topmenu['permission']))
                <li class="nav-item">
                    <a class="nav-link active" href="#" role="button" data-toggle="collapse">
                        <i class="{{$topmenu['icon']}}"></i>{{$topmenu['name']}}
                    </a>
                    <div class="collapse show" id="sidebarPages">
                        <ul class="nav nav-sm flex-column">
                            @foreach($topmenu['menus'] as $menu)
                                @can($menu['permission'])
                                    <li class="nav-item">
                                        <a href="{{$menu['route']}}" class="nav-link">
                                            {{$menu['name']}}
                                        </a>
                                    </li>
                                @endcan
                            @endforeach
                        </ul>
                    </div>
                </li>
            @endif
        @endforeach
    </ul>


    {{--分割线--}}
    <hr class="my-3">

    <!-- Navigation -->
    <ul class="navbar-nav mb-md-3">
        <li class="nav-item">
            <a class="nav-link " href="changelog.html">
                <i class="fe fe-git-branch"></i> 道行 <span class="badge badge-primary ml-auto">v1.2.0</span>
            </a>
        </li>
    </ul>
    <!-- User (md) -->
    <div class="navbar-user mt-auto d-none d-md-flex">
        <!-- Icon -->
        <a href="#sidebarModalActivity" class="text-muted" data-toggle="modal">
              <span class="icon">
                <i class="fe fe-bell"></i>
              </span>
        </a>
        <!-- Dropup -->
        <div class="dropup">

            <!-- Toggle -->
            <a href="#!" id="sidebarIconCopy" class="dropdown-toggle" role="button" data-toggle="dropdown"
               aria-haspopup="true" aria-expanded="false">
                <div class="avatar avatar-sm avatar-online">
                    <img src="{{auth()->user()->icon}}"
                         class="avatar-img rounded-circle" alt="...">
                </div>
            </a>

            <!-- Menu -->
            <div class="dropdown-menu" aria-labelledby="sidebarIconCopy">
                <a href="profile-posts.html" class="dropdown-item">Profile</a>
                <a href="settings.html" class="dropdown-item">Settings</a>
                <hr class="dropdown-divider">
                <a href="sign-in.html" class="dropdown-item">Logout</a>
            </div>

        </div>
        <!-- Icon -->
        <a href="#sidebarModalSearch" class="text-muted" data-toggle="modal">
              <span class="icon">
                <i class="fe fe-search"></i>
              </span>
        </a>
    </div>


</div>